<template>
  <div class=""></div>
</template>

<script>
  export default {
    name: "UnlockSucc",
    watch: {
      $route(val) {
        this.initPage(val.query);
      },
    },
    methods: {
      initPage(query) {
        let _this = this;
        if (query.state === 'success') {
          this.util.showPopup({
            content: '解锁成功',
            close() {
              _this.$router.go(-1);
            },
          });
        } else {
          this.http.$post('webcat/api/pa_umeng_send', {
            openid: this.$store.getters.wxUserInfo.openid,
          }).then(res => {
            this.$router.replace({
              name: 'UnlockSucc',
              query: {
                state: 'success',
              },
            });
          }).catch(this.$err);
        }
      },
    },
    created() {
      this.initPage(this.$route.query);
    },
  }
</script>

<style scoped>

</style>
